package model;

import mapproviderapi.MapTileBound;

public class Bound2D {
	private int top;

	private int left;
	
	private int width;
	
	private int height;
	
	public int getTop() {
		return top;
	}

	public void setTop(int top) {
		this.top = top;
	}

	public int getLeft() {
		return left;
	}

	public void setLeft(int left) {
		this.left = left;
	}

	public int getWidth() {
		return width;
	}

	public void setWidth(int width) {
		this.width = width;
	}

	public int getHeight() {
		return height;
	}

	public void setHeight(int height) {
		this.height = height;
	}

	public Bound2D(){
		
	}
	
	public Bound2D(int top, int left, int width, int height){
		this.top = top;
		this.left = left;
		this.height = height;
		this.width = width;
	}
	
	public boolean isOutside(Bound2D bound){
		if ((left + width < bound.left || left > bound.left + bound.width) ||
                (top + height < bound.top || top > bound.top + bound.height)){
            return true;
        }
        return false;

	}
	
	public boolean isInside(Bound2D bound){
		if ((left > bound.left && bound.left + bound.width > left + width) &&
                (top > bound.top && bound.top + bound.height > top + height)){
            return true;
        }
        return false;
	}
}
